package com.zhny.aiot.leakage.valve.plugin.model;

import com.zhny.aiot.plugin.ActionValue;
import com.zhny.aiot.plugin.PropertyValue;
import com.zhny.aiot.plugin.model.*;
import lombok.Data;

@Data
public class LeakageValveStoreEntry extends StoreEntity {
    @PropertyValue(alias = "电压",description = "电池电压",unit = "V",icon=IconConstract.Voltage,variableType=VariableType.Numerical,actions={
            @ActionValue(name=Operate.Check, commandCode="queryVoltage", eventType=EventType.Click)
    })
    private Double voltage;
    @PropertyValue(alias = "A阀门状态",description = "A阀门状态",unit = "",icon=IconConstract.Other,variableType=VariableType.StandardValve,actions={
            @ActionValue(name=Operate.Open,commandCode="openValve1",eventType=EventType.Click),
            @ActionValue(name=Operate.Close,commandCode="closeValve1",eventType=EventType.Click),
            @ActionValue(name=Operate.Query,commandCode="queryStatus",eventType=EventType.Click),
            @ActionValue(name=Operate.Init,commandCode="initialize",eventType=EventType.Click)
    })
    private Boolean a;
    @PropertyValue(alias = "B阀门状态",description = "B阀门状态",unit = "",icon=IconConstract.Other,variableType=VariableType.StandardValve,actions={
            @ActionValue(name=Operate.Open,commandCode="openValve2",eventType=EventType.Click),
            @ActionValue(name=Operate.Close,commandCode="closeValve2",eventType=EventType.Click),
            @ActionValue(name=Operate.Query,commandCode="queryStatus",eventType=EventType.Click),
            @ActionValue(name=Operate.Init,commandCode="initialize",eventType=EventType.Click)
    })
    private Boolean b;
    @PropertyValue(alias = "C阀门状态",description = "C阀门状态",unit = "",icon=IconConstract.Other,variableType=VariableType.StandardValve,actions={
            @ActionValue(name=Operate.Open,commandCode="openValve3",eventType=EventType.Click),
            @ActionValue(name=Operate.Close,commandCode="closeValve3",eventType=EventType.Click),
            @ActionValue(name=Operate.Query,commandCode="queryStatus",eventType=EventType.Click),
            @ActionValue(name=Operate.Init,commandCode="initialize",eventType=EventType.Click)
    })
    private Boolean c;
    @PropertyValue(alias = "D阀门状态",description = "D阀门状态",unit = "",icon=IconConstract.Other,variableType=VariableType.StandardValve,actions={
            @ActionValue(name=Operate.Open,commandCode="openValve4",eventType=EventType.Click),
            @ActionValue(name=Operate.Close,commandCode="closeValve4",eventType=EventType.Click),
            @ActionValue(name=Operate.Query,commandCode="queryStatus",eventType=EventType.Click),
            @ActionValue(name=Operate.Init,commandCode="initialize",eventType=EventType.Click)
    })
    private Boolean d;

    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("voltage=").append(this.voltage);
        sb.append(", valve1status=").append(this.a);
        sb.append(", valve2status=").append(this.b);
        sb.append(", valve3status=").append(this.c);
        sb.append(", valve4status=").append(this.d);
        return sb.toString();
    }
}
